package cn.jdy.plugins.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import cn.jdy.common.ctrl.BaseCtrl;
import cn.jdy.plugins.entity.FastMail;
import cn.jdy.plugins.service.FastMailService;
/**
 * @title 快递网点控制类
 * @date 2015-11-19
 * @author daihu
 */
@Controller
@RequestMapping("/fastmail")
public class FastMailCtrl extends BaseCtrl {
  @Autowired
  private FastMailService fastmailService;


  /**
   * 显示快递网点分布
   * @return
   */
  @RequestMapping("")
  public ModelAndView list(FastMail entity) {
    ModelAndView mv = new ModelAndView("/fastMail.jsp");
    mv.addObject("dataList", fastmailService.query(entity));
    return mv;
  }


  /**
   * 编辑
   * @param id
   * @return
   */
  @RequestMapping("/edit/{id}")
  public ModelAndView edit(@PathVariable Long id) {
    ModelAndView mv = new ModelAndView("/fastMaildetail.jsp");
    mv.addObject("data", id==null||id==0 ? id : this.fastmailService.find(id));
    return mv;
  }


}
